//
//  WPAttributedStyleAction.h
//  WPAttributedMarkupDemo
//
//  Created by Nigel Grange on 20/10/2014.
//  Copyright (c) 2014 Nigel Grange. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface WPAttributedStyleAction : NSObject

@property (readwrite, copy) void (^action) ();

- (instancetype)initWithAction:(void (^)())action;
+(NSArray*)styledActionWithAction:(void (^)())action;
-(NSArray*)styledAction;


@end

// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com 

/*
 #import "NSString+WPAttributedMarkup.h"
 
 #import "WPAttributedStyleAction.h"
 #import "WPHotspotLabel.h"
 
 
 NSDictionary* style1 = @{@"body":[UIFont fontWithName:@"HelveticaNeue" size:18.0],
 @"bold":[UIFont fontWithName:@"HelveticaNeue-Bold" size:18.0],
 @"red": [UIColor redColor]};
 
 
 NSDictionary* style2 = @{@"body" :
 @[[UIFont fontWithName:@"HelveticaNeue-Bold" size:18.0],
 [UIColor darkGrayColor]],
 @"u": @[[UIColor blueColor],
 @{NSUnderlineStyleAttributeName : @(kCTUnderlineStyleSingle|kCTUnderlinePatternSolid)}
 ],
 @"thumb":[UIImage imageNamed:@"thumbIcon"] };
 
 NSDictionary* style3 = @{@"body":[UIFont fontWithName:@"HelveticaNeue" size:22.0],
 @"help":[WPAttributedStyleAction styledActionWithAction:^{
 NSLog(@"Help action");
 }],
 @"settings":[WPAttributedStyleAction styledActionWithAction:^{
 NSLog(@"Settings action");
 }],
 @"link": [UIColor orangeColor]};
 
 
 self.label1.attributedText = [@"Attributed <bold>Bold</bold> <red>Red</red> text" attributedStringWithStyleBook:style1];
 self.label2.attributedText = [@"<thumb> </thumb> Multiple <u>styles</u> text <thumb> </thumb>" attributedStringWithStyleBook:style2];
 self.label3.attributedText = [@"Tap <help>here</help> to show help or <settings>here</settings> to show settings" attributedStringWithStyleBook:style3];

*/